package com.google.code.xconf.schema.definition.value.options;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class CompoundOptions implements Options {

    private Set<Options> options = new HashSet<>();

    public CompoundOptions(Collection<Options> options) {
        this.options.addAll(options);
    }

    @Override
    public boolean matches(String value, boolean caseSensitive) {
        for (Options op : options) {
            if (op.matches(value, caseSensitive)) {
                return true;
            }
        }
        return false;
    }
}
